package com.google.code.irouter.portal.client.dashboard.main.center.managers.relation.browser.editor.detail;

import com.google.code.irouter.portal.client.AppConstants;
import com.google.code.irouter.portal.client.dashboard.main.center.managers.relation.browser.editor.detail.consumer.Source;
import com.google.code.irouter.portal.client.dashboard.main.center.managers.relation.browser.editor.detail.consumer.Target;
import com.google.gwt.core.client.GWT;
import com.gwtext.client.core.Margins;
import com.gwtext.client.core.RegionPosition;
import com.gwtext.client.widgets.Panel;
import com.gwtext.client.widgets.layout.BorderLayout;
import com.gwtext.client.widgets.layout.BorderLayoutData;

public final class Consumer extends Panel {
	
	private static final AppConstants CONSTANTS = GWT.create(AppConstants.class);
	
	private Target target; 
	private Source source; 
	
	public Consumer() {
		super();
		this.setId(Consumer.class.getName());
		
		BorderLayoutData targetLayout = new BorderLayoutData(RegionPosition.CENTER);
		targetLayout.setMargins(new Margins(5, 5, 5, 5));
		BorderLayoutData sourceLayout = new BorderLayoutData(RegionPosition.EAST);
		sourceLayout.setMargins(5, 5, 5, 5);
		
		this.setTitle(CONSTANTS.com_google_code_irouter_portal_client_dashboard_main_center_managers_relation_browser_editor_detail_consumer_title());
		this.setLayout(new BorderLayout());
		this.setBorder(false);
		target = new Target();
		source = new Source();
		this.add(target, targetLayout);
		this.add(source, sourceLayout);
	}

	public Target getTarget() {
		return target;
	}
	
	public void reset() {
		target.reset();
		source.reset();
	}

}
